{% comment %}
/* Copyright 2009 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
{% endcomment %}
{% extends 'base.html' %}
{% block content %}
<div id="edit-message">
{% if confirmation %}
<div class="success">Update Completed!</div>
{% else %}
&nbsp;
{% endif %}
</div>
Add New Link:<br>
<form method="post">
<table class="table-list">
  <thead>
    <tr class="table-head">
      <td>
        Anchor
        {% if warnings.anchor and new %}
           - <span class="warning">
            Anchors must be a string and are required.
          </span>
        {% endif %}
      </td>
      <td>
        Url
        {% if warnings.url and new %}
           - <span class="warning">
            Don't forget the http://.
          </span>
        {% endif %}
      </td>
      <td>
        Nofollow
        {% if warnings.nofollow and new %}
           - <span class="warning">
            Just check the box or don't.
          </span>
        {% endif %}
      </td>
      <td></td>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <input
          type="text"
          class="text-input"
          name="anchor"
          value="{{link.anchor}}">
      </td>
      <td>
        <input
          type="text"
          class="text-input url-input"
          name="url"
          value="{{link.url}}">
      </td>
      <td>
        <input
          type="checkbox"
          name="nofollow"
          value="nofollow"
          {% if link.nofollow %}
          checked="true"
          {% endif %}>
      </td>
      <td>
        <input type="submit" name="new" value="Create New Link">
      </td>
    </tr>
  </tbody>
</table>
</form>
Links *:<br>
<form method="post">
<table class="table-list">
  <thead>
    <tr class="table-head">
      <td>Delete</td>
      <td>Anchor</td>
      <td>Url</td>
      <td>Nofollow</td>
    </tr>
  </thead>
  <tbody>
  {% for link in links %}
    <tr>
      <td>
        <input
          type="checkbox"
          name="delete_{{forloop.counter}}"
          value="{{link.key}}">
      </td>
      <td>
        <input
          type="text"
          class="text-input"
          name="anchor_{{forloop.counter}}_{{link.key}}"
          value="{{link.anchor}}">
          {% if warnings.anchor and not new %}
          {% for warning in warnings.anchor %}
          {% ifequal warning link.link %}
          <span class="warning">Double check anchor.</span>
          {% endifequal %}
          {% endfor %}
          {% endif %}
      </td>
      <td>
        <input
          type="text"
          class="text-input url-input"
          name="url_{{link.key}}"
          value="{{link.url}}">
          {% if warnings.url and not new %}
          {% for warning in warnings.url %}
          {% ifequal warning link.link %}
          <span class="warning">Don't forget the http://.</span>
          {% endifequal %}
          {% endfor %}
          {% endif %}
      </td>
      <td>
        <input
          type="checkbox"
          {% if link.nofollow %}
          checked="true"
          {% endif %}
          name="nofollow_{{link.key}}"
          value="nofollow">
      </td>
    </tr>
  {% endfor %}
  <tr>
    <td colspan="4">
      <input
        type="submit"
        name="edit"
        value="Submit Link Changes">
      </td>
    </tr>
  </tbody>
</table>
</form>
* Links will be under the heading "{{blog.link_title}}" on the live site. 
(change in <a href="/admin/settings">settings</a>)
{% endblock %}
